-
Notifications
You must be signed in to change notification settings - Fork 639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat ContextProxy to improve state management #1235
base: main
Are you sure you want to change the base?
Conversation
|
c12aea5
to
fc11d96
Compare
- Add ContextProxy class as a wrapper around VSCode's ExtensionContext - Implement batched state updates for performance optimization - Update ClineProvider to use ContextProxy instead of direct context access - Add comprehensive test coverage for ContextProxy - Extract SECRET_KEYS and GLOBAL_STATE_KEYS constants for better maintainability
fc11d96
to
fbb5a19
Compare
@@ -81,6 +97,79 @@ export type GlobalStateKey = | |||
| "unboundModelInfo" | |||
| "modelTemperature" | |||
| "modelMaxTokens" | |||
| "anthropicThinking" // TODO: Rename to `modelMaxThinkingTokens`. | |||
| "modelMaxThinkingTokens" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still have references to anthropicThinking? Maybe should leave this cleanup for another PR
// Build the apiConfiguration object combining state values and secrets | ||
const apiConfiguration: ApiConfiguration = { | ||
apiProvider, | ||
apiModelId: stateValues.apiModelId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there some way to use the globalstatekeys here so we don't need to repeat this big list? Or is it a different subset of the list?
} | ||
} | ||
|
||
// Called when the provider is disposing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When does this happen?
Description
This feature will we can open multiple window (which can have different config (mode / api config))
Type of change
How Has This Been Tested?
Checklist:
Additional context
Related Issues
Reviewers
Important
Introduces
ContextProxy
for efficient state management inClineProvider
, with batched updates and comprehensive testing.ContextProxy
class incontextProxy.ts
to buffer state changes and secrets, committing them on request or disposal.ClineProvider.ts
withContextProxy
for efficient state management.SECRET_KEYS
andGLOBAL_STATE_KEYS
constants inglobalState.ts
for maintainability.ContextProxy
incontextProxy.test.ts
.ClineProvider.test.ts
to mock and testContextProxy
integration.ClineProvider
to useContextProxy
for state and secret management, ensuring proper disposal and state handling.This description was created by
for dec624c. It will automatically update as commits are pushed.